﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//buddy
using Zeta;
using Zeta.Common;
using Zeta.CommonBot;
using Zeta.Common.Plugins;
using Zeta.Internals;
using Zeta.Internals.Actors;
using Zeta.Internals.Service;

namespace MyBuddy.Local
{
    public class BuddyFollowerPlugin : IPlugin
    {
        DateTime LastPostionCheck { get; set; }

        public string Author
        {
            get { return "xsol"; }
        }

        public string Description
        {
            get { return "Follows the leader."; }
        }

        public System.Windows.Window DisplayWindow
        {
            get { return null; }
        }

        public string Name
        {
            get { return "MyBuddy.Follower"; }
        }

        public void OnDisabled()
        {

        }

        public void OnEnabled()
        {

        }

        public void OnInitialize()
        {

        }

        public void OnPulse()
        {
            if (DateTime.Now.Subtract(LastPostionCheck).TotalMilliseconds > 2250)
            {
                LastPostionCheck = DateTime.Now;
                DBFileMonitor.GLOBAL.FollowLeader();
            }
        }

        public void OnShutdown()
        {

        }

        public Version Version
        {
            get { return new Version(0,0,1); }
        }

        public bool Equals(IPlugin other)
        {
            return (this.Name == other.Name && this.Version == other.Version) ? true : false;
        }
    }
}
